package homework25;

public class EncryptionDecorator extends EncryptionComponent{//抽象装饰类
    EncryptionComponent encryptionComponent;

    public EncryptionDecorator(EncryptionComponent encryptionComponent){
        super(encryptionComponent);
    }

    @Override
    String encryption(String str) {
        return encryptionComponent.encryption(str);
    }
}

class SecondEncryption extends EncryptionDecorator{//加密算法

    public SecondEncryption(EncryptionComponent encryptionComponent) {
        super(encryptionComponent);
    }

    @Override
    String encryption(String str) {
        return super.encryption(str);
    }

    public String SecondEncryption(String str){
        return "二次加密算法..";
    }
}

